using Godot;
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;


public enum WeatherType
{
    Sunny,
    Rainy,
    Snowy
}




public enum DoorState { Closed, Open, Disabled }
public enum PlayerColor { Red, Blue, Green }


public partial class Cfg : Node
{


    public static bool IsDebugMode { get; set; } = true;


    // --- 层配置 ---
    public const int WorldLayer = 1;
    public const int RedLayer = 2;
    public const int BlueLayer = 4;
    public const int GreenLayer = 8;
    public const int PlayerLayer = 16;
    public const int ProjectileLayer = 32;
    // 颜色更新信号
    [Signal] public delegate void ColorChangedEventHandler(PlayerColor newColor);


    public static PlayerColor CurPlayerColor { get; set; } = PlayerColor.Red;
    public static PlayerColor BridgeColor { get; set; } = PlayerColor.Red;



    // 颜色音效

    public const float RedPitch = 0.8f;
    public const float BluePitch = 1.0f;
    public const float GreenPitch = 1.2f;



    // public override void _Ready()
    // {
    //     // 初始化配置
    // }


    public static void Swaper<T>(ref T a, ref T b)
    {
        T temp = a;
        a = b;
        b = temp;
    }


    public static PlayerColor NextColor(PlayerColor color)
    {

        return color switch
        {
            PlayerColor.Red => PlayerColor.Blue,
            PlayerColor.Blue => PlayerColor.Green,
            PlayerColor.Green => PlayerColor.Red,
            _ => PlayerColor.Red

        };
    }

    public static Color GetColorValue(PlayerColor color)
    {
        return color switch
        {
            PlayerColor.Red => Colors.Red,
            PlayerColor.Blue => Colors.Cyan,
            PlayerColor.Green => Colors.Lime,
            _ => Colors.White
        };
    }


    public static Dictionary<string, string> CharacterColors = new Dictionary<string, string>()
    {
        { "玩家", "#00ccff" },  // 赛博蓝
        { "Player", "#00ccff" },
        { "门卫", "#ff0000" },  // 警告红
        { "系统", "#00ff00" },  // 终端绿
        { "旁白", "#ffffff" },  // 白
    };


}
